|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
EJBRemoteWriter.java | 100% | 100% | 100% | 100% |
|
1 |
/*
|
|
2 |
* Copyright 2001-2004 The Apache Software Foundation.
|
|
3 |
*
|
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5 |
* you may not use this file except in compliance with the License.
|
|
6 |
* You may obtain a copy of the License at
|
|
7 |
*
|
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9 |
*
|
|
10 |
* Unless required by applicable law or agreed to in writing, software
|
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13 |
* See the License for the specific language governing permissions and
|
|
14 |
* limitations under the License.
|
|
15 |
*/
|
|
16 |
|
|
17 |
package org.apache.geronimo.ews.ws4j2ee.toWs.ejb;
|
|
18 |
|
|
19 |
import org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext;
|
|
20 |
import org.apache.geronimo.ews.ws4j2ee.context.SEIOperation;
|
|
21 |
import org.apache.geronimo.ews.ws4j2ee.context.j2eeDD.EJBContext;
|
|
22 |
import org.apache.geronimo.ews.ws4j2ee.toWs.GenerationFault;
|
|
23 |
import org.apache.geronimo.ews.ws4j2ee.toWs.JavaInterfaceWriter;
|
|
24 |
|
|
25 |
import java.util.ArrayList;
|
|
26 |
import java.util.Iterator;
|
|
27 |
|
|
28 |
/**
|
|
29 |
* This class can be used to write the appropriate EJB Remote interface
|
|
30 |
* class for the given port type.
|
|
31 |
*
|
|
32 |
* @author Rajith Priyanga
|
|
33 |
* @author Srinath Perera
|
|
34 |
* @date Nov 26, 2003
|
|
35 |
*/
|
|
36 |
public class EJBRemoteWriter extends JavaInterfaceWriter { |
|
37 |
private String name;
|
|
38 |
protected EJBContext ejbcontext;
|
|
39 |
|
|
40 |
/**
|
|
41 |
* Constructs a EJBRemoteWriter.
|
|
42 |
*
|
|
43 |
* @param portType The port type which contains the details.
|
|
44 |
* @throws GenerationFault
|
|
45 |
*/
|
|
46 | 8 |
public EJBRemoteWriter(J2EEWebServiceContext context, EJBContext ejbcontext) throws GenerationFault { |
47 | 8 |
super(context, ejbcontext.getEjbRemoteInterface());
|
48 | 8 |
this.ejbcontext = ejbcontext;
|
49 |
} |
|
50 |
|
|
51 | 8 |
protected String getExtendsPart() {
|
52 | 8 |
return " extends javax.ejb.EJBObject"; |
53 |
} |
|
54 |
|
|
55 | 8 |
protected void writeAttributes() throws GenerationFault { |
56 |
} |
|
57 |
|
|
58 | 8 |
protected void writeMethods() throws GenerationFault { |
59 | 8 |
String parmlistStr = "";
|
60 | 8 |
ArrayList operations = j2eewscontext.getMiscInfo().getSEIOperations(); |
61 | 8 |
for (int i = 0; i < operations.size(); i++) { |
62 | 27 |
SEIOperation op = (SEIOperation) operations.get(i); |
63 | 27 |
String returnType = op.getReturnType(); |
64 | 27 |
if (returnType == null) |
65 | 3 |
returnType = "void";
|
66 | 27 |
out.write("\tpublic " + returnType + " " + op.getMethodName() + "("); |
67 | 27 |
Iterator pas = op.getParameterNames().iterator(); |
68 | 27 |
boolean first = true; |
69 | 27 |
while (pas.hasNext()) {
|
70 | 42 |
String name = (String) pas.next(); |
71 | 42 |
String type = (String) op.getParameterType(name); |
72 | 42 |
if (first) {
|
73 | 23 |
first = false;
|
74 | 23 |
out.write(type + " " + name);
|
75 | 23 |
parmlistStr = parmlistStr + name; |
76 |
} else {
|
|
77 | 19 |
out.write("," + type + " " + name); |
78 | 19 |
parmlistStr = "," + name;
|
79 |
} |
|
80 |
} |
|
81 | 27 |
out.write(") throws java.rmi.RemoteException");
|
82 |
//ejb giving problems deploying check this
|
|
83 |
// ArrayList faults = op.getFaults();
|
|
84 |
// for (int j = 0; j < faults.size(); j++) {
|
|
85 |
// out.write("," + (String) faults.get(i));
|
|
86 |
// }
|
|
87 | 27 |
out.write(";\n");
|
88 |
} |
|
89 |
} |
|
90 |
|
|
91 |
} |
|
92 |
|
|